Most computer programs exist as compiled object code. The compiled object code is designed to operate only on one particular operating system running on one particular computer processor architecture. To distribute a program for several different computer architectures the original source code must be compiled into object code for each different computer processor architecture and each different operating system.
To create a highly portable programming environment, Sun Microsystems, Inc. introduced Java. Java is an object oriented programming language that is compiled from a well-defined source code into Java byte codes. The Java byte codes are designed to execute on a "Java Virtual Machine." A Java Virtual Machine is not an actual hardware platform. Instead, a Java Virtual Machine is a low level software emulator that can be implemented on many different computer processor architectures and under many different operating systems. Thus, a single compiled Java program can be distributed to any computer processor architecture and operating system that has a Java Virtual Machine implementation available. Therefore, a programmer can write a single Java program and the program will run on many different computer platforms.
Early Java Virtual Machines were implemented as interpreters. In a Java interpreter, each Java byte code is examined and a corresponding operation is performed in the Java Virtual Machine. Although Java byte code interpreters achieve the goal of having a portable programming environment, Java interpreters suffer from slow performance.
To improve the performance of Java Virtual machines, Java compilers were created. Java compilers translate the Java byte codes into native computer processor instructions for the particular computer architecture that the Java Virtual Machine is running on. Then, the computer processor runs the Java program by directly running the compiled native code. Such compiled Java programs execute much faster than Java programs that are executed using a Java interpreter.
In many applications Java programs are distributed in real time across a computer network. For example, a user may download a Java program from a server into a local client computer system. The user then typically wishes to immediately execute the downloaded Java program. To provide an immediate response to the user, a Java byte code compiler immediately compiles the Java program into native processor code. This technique is known as "Just-In-Time" compiling.
Just-In-Time compilation must be performed very quickly to prevent user frustration. Therefore, Just-In-Time compilation can not use computationally expensive techniques to optimize the generated native processor code. Instead, Just-In-Time compilers must generate the best possible code during one or two passes through the source code. It would therefore be desirable to have a compiler that generates high quality object code with a short compile time.